<template>
	<div class="newsinfo-container">
		<h3 class="title">{{ goodsinfo.title }}</h3>
		<hr>
		<div class="content" v-html="goodsinfo.text"></div>
	</div>
</template>

<script>
	import { Toast } from 'mint-ui'
	export default {
		data() {
			return {
				id: this.$route.params.index,
				goodsinfo:{}
			}
		},
		created() {
			this.getGoodsInfo();
		},
		methods: {
			getGoodsInfo() {
				this.$http.get('data.php').then(result => {
					if(result.body.status == true) {
						this.goodsinfo = result.body.goods[this.id];
//						console.log(this.goodsinfo);
					} else {
						Toast('获取商品图文信息失败...');
					}
				})
			},
		},
	}
</script>

<style lang="scss">
	.newsinfo-container {
		padding: 0 15px;
		.title {
			width: 100%;
			font-size: 16px;
			text-align: center;
			margin: 15px 0;
			color: rgb(38,162,255);
			text-overflow: ellipsis;
			overflow: hidden;
			white-space:nowrap;
		}
		.subtitle {
			font-size: 13px;
			color: rgb(38,162,255);
			display: flex;
			flex-direction: row;
			justify-content: space-between;
		}
		.content {
			text-indent: 1em;
			font-size: 12px;
			color: #666;
			img{
				width: 100%;
				margin-top: 5px;
			}
		}
	}
</style>